
<template>
	<!--
    	作者：1550495493@qq.com
    	时间：2019-08-13
    	描述：项目管理员-项目审核
    -->
	<div class="HomePage">
		<div class="location">
			<div class="location-text fl">
				<img class="location-img fl" src="../../images/ProjectManager/lixian.png" />
				<p class="fr">项目立项</p>
			</div>
			<img class="biaotibg fl" src="../../images/home/biaotibg.png" />
		</div>
		<div class="IssuedNotice-box">
			<div class="search-box">
	          <input name="search" class="search" id="searchRoleVal" autocomplete="off" type="text" v-model="search"/>
	          <input class="btn" type="button" value="搜索" @click="searchTodo"/>
			</div>
		</div>
		<div class="PressRelease-list">
			<table>
				<thead>
					<tr>
						<th class="w200">项目名称</th>
						<th class="w100"> 合同开始时间 </th>
						<th class="w100">合同结束时间</th>
						<th class="w80">项目类型</th>
						<th class="w80">任务书 </th>
			            <th class="w80">审核状态</th>
			            <th class="w80">项目状态</th>
						<th class="w100">审核</th>
						<th class="w100">操作</th>
						<th class="w100">上传科研系统</th>
					</tr>
				</thead>
				<tbody>
          <tr v-if="projectList.length == 0">
            <td colspan="10" class="center">暂无数据！</td>
          </tr>
          <tr v-for="(project,index) in projectList" :class="index==curIndex?'activeBg':''" @click="choosed(index)">
						<td :title="project.name"><span class="show-twoline">{{project.name}}</span></td>
						<td>{{formatData(project.contractBeginTime)}}</td>
						<td>{{formatData(project.contractEndTime)}}</td>
						<td>{{project.type == 1 ? "横向项目" : "研究院项目"}}</td>
						<td><input type="button" value="查看" class="delete write" @click="preview(project.taskBookUrl)"/></td>
            <td>{{auditStatus(project.initiationAuditStatus)}}</td>
            <td>{{project.areasStatus == 6 || project.areasStatus == 3 ? "无效" : "有效"}}</td>
            <td>
              <template v-if="project.areasStatus == 6 || project.areasStatus == 3 ? false : true">
                <template v-if="project.initiationAuditStatus == 1">
                  <input type="button" value="通过" class="through" @click="auditProject(project.id,2)"/>|
                  <input type="button" class="through" value="不通过"  @click="auditModelShow(project.id)"/>
                </template>
                <!--<template v-if="project.initiationAuditStatus == 2 && project.accountingStatus == 0">
                  <input type="button" value="生成上账文件" class="delete write" @click="accounting(project.id)"/>|
                </template>-->
              </template>
            </td>
						<td>
              <input @click="approvalEnd(project.id)" type="button" value="生成上账文件" class="delete write" v-if="project.initiationAuditStatus != 2 || project.areasStatus == 6 || project.areasStatus == 3 ? false : true"/>
              <!--<input type="button" value="提醒专家" class="delete" />-->
            </td>
						<td v-if="project.pushStatus == 0">
              <input type="button" value="提交" class="delete write"/>
            </td>
					</tr>
				</tbody>
			</table>

		</div>
			<!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
			<pageination :total="total" :size="size" :page="page" :changge="pageFn" @child="obtainChild"></pageination>
    <!-- - 不通过 退出 模态框-->
    <div v-if="auditModel" class="tenant-model">
      <div class="tenant-model-content  disagree">
        <header class="tenant-model-header">
          <h3>审核不通过</h3>
          <span @click="closeModel" class="closeModel">×</span>
        </header>
        <div class="tenant-model-body">
          <div class="search-contain">
            <!--		&lt;!&ndash;模态框内容板块&ndash;&gt;-->
            <form class="form-box">
               <div class="msg">
                <label v-if="!auditObj.initiationAuditMsg&&initiationAuditMsg">请输入不通过内容</label>
                <label v-else-if="auditObj.initiationAuditMsg!=null&&auditObj.initiationAuditMsg.length > 100">内容最多只能输入100个字</label>
              </div>
              <div class="form-line input-required">
                <label class="textarea-label">内容：</label>
                <div class="input-box textarea-box">
                  <textarea name="screenAuditMsg" v-model="auditObj.initiationAuditMsg"></textarea>
                </div>
              </div>

              <div class="form-line">
                <label class="textarea-label">附件：</label>
                <input name="screenAuditEnclosureUrl" type="hidden" v-model="auditObj.initiationAuditEnclosureUrl"/>
                <input type="file" ref="uploadFile" accept=".txt,.rar,.zip,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.exe,image/*" @change="idFrontImg($event)" style="display: none;" />
                <input type="button" value="上传附件" class="delete write" @click="$refs.uploadFile.click()"/>
                <input type="button" value="删除附件" class="delete write" @click="deleteEnclosure()"  v-if="FileUpload.length"/>
                <ul class="img-box" v-if="FileUpload.length">
                  <li v-for="item in FileUpload">{{item}}</li>
                </ul>
              </div>
            </form>
          </div>
        </div>
        <footer class="tenant-model-footer">
          <button class="determine" @click="auditData">确定</button>
        </footer>
      </div>
    </div>
</div>
</template>

<script src="./project.js"></script>

<style scoped>
	@import "project.css"
</style>
